$(function () {
    //Demo
    layui.use('form', function(){
        var form = layui.form;
    });
    selectCodeType("sex");
    selectCodeType("education");
    selectMyMessage();
})
function selectMyMessage() {
    let data = myAjax("/personnel/selectMyMessage",'',"post");
    data = data.personnelBean;
    $("#personnelNumber").val(data.personnelNumber);
    $("#personnelType").val(data.personnelType);
    $("#personnelGroup").val(data.personnelGroup);
    $("#username").val(data.name);
    $("#sex").val(data.sex);
    $("#age").val(data.age);
    $("#education").val(data.education);
    $("#graduateSchool").val(data.graduateSchool);
    $("#nativeplace").val(data.nativeplace);
    $("#location").val(data.location);
    $("#phone").val(data.phone);
    $("#urgentphone").val(data.urgentphone);
}
function updateMyMessage() {
    let data1 ={
        personnelNumber:$("#personnelNumber").val(),
        personnelType:$("#personnelType").val(),
        personnelGroup:$("#personnelGroup").val(),
        name:$("#username").val(),
        sex:$("#sex").val(),
        age:$("#age").val(),
        education:$("#education").val(),
        graduateSchool:$("#graduateSchool").val(),
        nativeplace:$("#nativeplace").val(),
        location:$("#location").val(),
        phone:$("#phone").val(),
        urgentphone:$("#urgentphone").val()
    }
    let data = myAjax("/personnel/updateMessage",data1,"post");
    if (data.result==1){
        alert("更新成功");
    }
}